﻿using System.Windows.Forms;
using ClickOnceMaster.Common;
using ClickOnceMaster.Properties;
using ClickOnceMaster.WizardConfiguration;

namespace ClickOnceMaster.Pages
{
    public partial class RunPage : WizardPage
    {
        #region Instance fileds

        private readonly Updater _updater;

        #endregion

        #region .ctors

        public RunPage()
        {
            InitializeComponent();
            Text = Resources.RunPage;

            _updater = new Updater();
            bsManifestOperation.DataSource = _updater.OperationList;
        }

        #endregion

        #region Instance methods

        #region WizardPage overrides

        /// <summary>
        /// Loads data to the page.
        /// </summary>
        protected override void LoadData()
        {
            base.LoadData();
            WizardSettings.Current.Save();
            _updater.Update();
        }

        /// <summary>
        /// Return the <see cref="Cursor"/> for whait state
        /// </summary>
        public override Cursor WhaitCursor
        {
            get
            {
                return Cursors.Default;
            }
        }

        #endregion

        #endregion
    }
}